import request from './request'

export function insertOrUpdateScript(data:any) {
    return request({
        url: '/scripts',
        method: 'post',
        data
    })
}

export function searchScripts(data:any, page:number, pageSize:number) {
    return request({
        url: '/scripts/search?page='+page+'&pageSize='+pageSize,
        method: 'post',
        data
    })
}

export function getScriptById(id:number) {
    return request({
        url: '/scripts/'+id,
        method: 'get'
    })
}

export function collectScript(id:number) {
    return request({
        url: '/scripts/collect/'+id,
        method: 'post'
    })
}

export function deleteCollection(id:number) {
    return request({
        url: '/scripts/deleteCollection/'+id,
        method: 'post'
    })
}